<?php

namespace app\common\model;


/**
 * 物流公司模型
 * Class Express
 * @package app\common\model
 */
class OrderExpress extends BaseModel
{
    protected $name = 'order_express';
    protected $updateTime = false;

    public static function getAll($order_id,$where = [])
    {
       $list =  Db('order_goods goods')
            ->field('goods.order_goods_id,goods.goods_name,if(express.order_express_id is null,0,express.`order_express_id`) order_express_id')
            ->join('order_express express','FIND_IN_SET(goods.order_goods_id,express.order_goods_ids)','left')
            ->where($where)
            ->where('goods.order_id',$order_id)
            ->order('order_express_id desc')
            ->select();
        return $list;
    }


}
